const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('comBase1717392408', {
    id: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 0,
      primaryKey: true,
      comment: "编号"
    },
    stock_code: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "代码"
    },
    stock_name: {
      type: DataTypes.STRING(30),
      allowNull: true,
      comment: "名字"
    },
    price: {
      type: DataTypes.DOUBLE(30,2),
      allowNull: true,
      defaultValue: 0.00,
      comment: "最新价"
    },
    raise_range: {
      type: DataTypes.DOUBLE(30,2),
      allowNull: true,
      defaultValue: 0.00,
      comment: "涨幅"
    },
    tx_amount: {
      type: DataTypes.DOUBLE(30,5),
      allowNull: true,
      defaultValue: 0.00000,
      comment: "成交额"
    },
    tx_count: {
      type: DataTypes.DOUBLE(30,5),
      allowNull: true,
      defaultValue: 0.00000,
      comment: "成交量"
    },
    tx_rate: {
      type: DataTypes.DOUBLE(30,2),
      allowNull: true,
      defaultValue: 0.00,
      comment: "换手率"
    },
    pb: {
      type: DataTypes.DOUBLE(30,2),
      allowNull: true,
      defaultValue: 0.00,
      comment: "市净率"
    },
    pe: {
      type: DataTypes.DOUBLE(30,2),
      allowNull: true,
      defaultValue: 0.00,
      comment: "市盈率"
    },
    count_rate: {
      type: DataTypes.DOUBLE(30,2),
      allowNull: true,
      defaultValue: 0.00,
      comment: "量比"
    },
    tc_name: {
      type: DataTypes.STRING(1000),
      allowNull: true,
      defaultValue: "",
      comment: "核心题材"
    },
    selected_board_reason: {
      type: DataTypes.STRING(5000),
      allowNull: true,
      defaultValue: "",
      comment: "入选原因"
    },
    tc_detail: {
      type: DataTypes.JSON,
      allowNull: true,
      comment: "题材详情"
    },
    company_type: {
      type: DataTypes.STRING(200),
      allowNull: true,
      defaultValue: "",
      comment: "公司类型"
    },
    company_url: {
      type: DataTypes.STRING(256),
      allowNull: false,
      defaultValue: "",
      comment: "公司简介"
    },
    update_time_hsja: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: "2020-03-23 00:00:00",
      comment: "沪深京A更新"
    },
    update_time_tc: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: "2020-03-23 00:00:00",
      comment: "题材更新"
    },
    update_time_holder_count: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: "2020-03-23 00:00:00",
      comment: "股东数更新"
    },
    company_name: {
      type: DataTypes.STRING(500),
      allowNull: true,
      defaultValue: "",
      comment: "公司名字"
    },
    main_business: {
      type: DataTypes.STRING(2000),
      allowNull: true,
      defaultValue: "",
      comment: "主营业务"
    },
    holder_total_num: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "股东人数"
    },
    holder_total_num_ratio: {
      type: DataTypes.DOUBLE(30,2),
      allowNull: true,
      comment: "股东变化率"
    },
    ave_free_shares_num: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "人均流通股数"
    },
    ave_free_shares_ratio: {
      type: DataTypes.DOUBLE(10,2),
      allowNull: true,
      comment: "人均流通股变化率"
    },
    hold_focus: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "筹码集中度"
    },
    ave_price: {
      type: DataTypes.DOUBLE(20,2),
      allowNull: true,
      comment: "股东股价"
    },
    ave_hold_amt: {
      type: DataTypes.DOUBLE(20,2),
      allowNull: true,
      comment: "人均金额"
    },
    hold_ratio_total: {
      type: DataTypes.DOUBLE(10,2),
      allowNull: true,
      comment: "十大股东持股合计(%)"
    },
    freehold_ratio_total: {
      type: DataTypes.DOUBLE(10,2),
      allowNull: true,
      comment: "十大流通股东持股合计(%) "
    },
    com_profile: {
      type: DataTypes.STRING(10000),
      allowNull: true,
      comment: "公司简介"
    },
    com_address: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "地址"
    },
    com_reg_capital: {
      type: DataTypes.DECIMAL(50,2),
      allowNull: false,
      comment: "注册资本"
    },
    update_time_com_profile: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: "2020-03-23 00:00:00",
      comment: "更新简介的时间"
    },
    stock_name_first_letter: {
      type: DataTypes.STRING(8),
      allowNull: false,
      defaultValue: "",
      comment: "名字首字母"
    },
    priority: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: 0,
      comment: "显示优先级"
    },
    tc_count: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: 0,
      comment: "题材个数"
    },
    is_rzrq: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: 0,
      comment: "融资融券"
    },
    board_type: {
      type: DataTypes.STRING(500),
      allowNull: true,
      defaultValue: "",
      comment: " 所属板块"
    },
    jj_count: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: 0,
      comment: "机构数量"
    }
  }, {
    sequelize,
    tableName: 'com_base_1717392408',
    timestamps: false
  });
};
